package com.qms.tubu.fragment.account;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.qms.tubu.R;
import com.qms.tubu.activity.account.LoginActivity;
import com.qms.tubu.activity.account.RegisterActivity;
import com.qms.tubu.fragment.BaseFragment;

/**
 * Created by Mad on 2015/7/20.
 */
public class DrawerLogoutFragment extends BaseFragment implements View.OnClickListener{

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        rootView=inflater.inflate(R.layout.fragment_drawer_logout,container,false);
        rootView.findViewById(R.id.drawer_login_btn).setOnClickListener(this);
        rootView.findViewById(R.id.drawer_portrait_image).setOnClickListener(this);
        rootView.findViewById(R.id.drawer_register_btn).setOnClickListener(this);
        return rootView;
    }

    @Override
    public void onClick(View v) {
        Intent intent=null;
        switch (v.getId())
        {
            case R.id.drawer_login_btn:
            case R.id.drawer_portrait_image:
                intent=new Intent(rootView.getContext(), LoginActivity.class);
                break;
            case R.id.drawer_register_btn:
                intent=new Intent(rootView.getContext(), RegisterActivity.class);
                break;
        }
        startActivity(intent);
    }

    @Override
    public void onResume() {
        super.onResume();
    }
}
